package des.output;

public class Output {
	public enum Mode {
		COMMANDLINE_BIN, COMMANDLINE_HEX, NONE
	};

	private static Mode mode = Mode.NONE;

	public static Mode getMode() {
		return mode;
	}

	public static void setMode(Mode mode) {
		Output.mode = mode;
	}

	public static void printTitle(String s) {
		if (mode != Mode.NONE) {
			String output = "\n****** " + s + " ******";
			System.out.println(output);
		}
	}

	public static void printLong(long l, String s) {
		if (mode != Mode.NONE) {
			String output = "";
			if (mode == Mode.COMMANDLINE_BIN) {
				output = s + ":\t" + Long.toBinaryString(l);
			} else if (mode == Mode.COMMANDLINE_HEX) {
				output = s + ":\t" + Long.toHexString(l);
			}
			System.out.println(output);
		}
	}

	public static void printInt(int i, String s) {
		if (mode != Mode.NONE) {
			String output = "";
			if (mode == Mode.COMMANDLINE_BIN) {
				output = s + ":\t" + Integer.toBinaryString(i);
			} else if (mode == Mode.COMMANDLINE_HEX) {
				output = s + ":\t" + Integer.toHexString(i);
			}
			System.out.println(output);
		}
	}
}
